<template>
	<div id="app">
		<div class="list">your list of items</div>
		<!-- add the component right after your list -->
		<mugen-scroll :handler="fetchData" :should-handle="!loading">
			loading...
		</mugen-scroll>
	</div>
</template>

<script>
	import MugenScroll from 'vue-mugen-scroll'
	export default {
		data() {
			// do not run handler when it's loading
			return {
				loading: false
			}
		},
		methods: {
			fetchData() {
				this.loading = true
				// ... the code you wanna run to fetch data
				let _this = this;
				_this.$http.get('/Client/Products?OnSale=1', null, localStorage.Authorization, res => {
					console.log('首页res', res)
					if(res.code === 200) {
						_this.mainDatas = res.data.list;
//						this.loading = false
					} else if(res.code === 101) {
						localStorage.fromPath = _this.$route.fullPath
						_this.$router.push({
							path: '/wx/login'
						})
					}
				})

			}
		},
		components: {
			MugenScroll
		}
	}
</script>